package com.urun.interceptor.hotanalysis.mapper.db2;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.urun.interceptor.hotanalysis.DTO.RankSearchDTO;
import com.urun.interceptor.hotanalysis.bean.RankSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RankSearchMapper extends BaseMapper<RankSearch> {

      List<RankSearchDTO> Search();

      @Select("SELECT (@i := @i + 1) AS RowNum,Word,cc.`Name` AS SourceName,DATEDIFF(UpdateListTime, ListingTime) AS trend,MaxRanking,HotNumber,ReadNumber,DiscussNumber,ListingTime FROM currency_ranking_result AS crr,currency_category AS cc,(SELECT @i := 0) AS it WHERE crr.SourceType = cc.ID AND ListingTime BETWEEN #{BeginTime} AND #{EndTime} AND Word LIKE #{input} AND crr.planID = #{PlanID}")
      List<RankSearchDTO> SearchLike(String input,String BeginTime,String EndTime,Integer PlanID);



}
